import torch
import ChatTTS
from IPython.display import Audio
import logging

import torchaudio  
 
# 定义ChatTTS 导入模型
chat = ChatTTS.Chat()
chat.load_models()
# 输入对应的文本
texts = ["123456",]
# 语音合成
wavs = chat.infer(texts, use_decoder=True)

Audio(wavs[0], rate=24_000, autoplay=True)